package com.dp.struts2.yc;

import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;

import org.apache.struts2.util.ServletContextAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.dp.pojo.News;
import com.dp.pojo.PageCtrl;
import com.dp.pub.BasePageAction;
import com.dp.pub.SysProperty;
import com.dp.service.jdc.ChannelServiceImpl3;
import com.dp.service.jdc.IndexServiceImpl;
import com.dp.service.jdc.SearchServiceImpl;
import com.dp.vo.TChannels;

@Controller
@Scope("session")
public class StateAction extends BasePageAction implements ServletContextAware{
    private List<TChannels> navChannels ;
    private List<List<TChannels>> nav2Channels;
    
    @Autowired
    private ChannelServiceImpl3 channelService;
    @Autowired
    private IndexServiceImpl indexService;
    public String state(){
        navChannels = indexService.getChannelsList(SysProperty.getPrep("hdnews_rootch"));
        nav2Channels = new ArrayList<List<TChannels>>();
        for (TChannels t : navChannels) {
            List<TChannels> temp = channelService.getLastChannels(t.getChannelId());
            nav2Channels.add(temp);
        }
        return "copyrightstate";
    }
    
    
    
    
    @Override
    public void setServletContext(ServletContext arg0) {
        // TODO Auto-generated method stub
        
    }




    public List<TChannels> getNavChannels() {
        return navChannels;
    }




    public void setNavChannels(List<TChannels> navChannels) {
        this.navChannels = navChannels;
    }




    public List<List<TChannels>> getNav2Channels() {
        return nav2Channels;
    }




    public void setNav2Channels(List<List<TChannels>> nav2Channels) {
        this.nav2Channels = nav2Channels;
    }




}
